﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AtletIS.Shared.Entities
{
    public class CompetitionEntity:EntityBase
    {
        private string _city;
        private string _organiser;
        
        private DateTime _dateFrom;
        private DateTime _dateTo;
        private DateTime _deadline;

        private bool _clubsCountries;

        private int _lanesCount = 0;
        private string[] _lanesQuality;
        private bool _isActive;
        private bool _sync;
        private int _webId;

        public string City
        {
            get { return _city; }
            set { _city = value; }
        }

        public string Organiser
        {
            get { return _organiser; }
            set { _organiser = value; }
        }

        public DateTime DateFrom
        {
            get { return _dateFrom; }
            set { _dateFrom = value; }
        }

        public DateTime DateTo
        {
            get { return _dateTo; }
            set { _dateTo = value; }
        }

        public DateTime Deadline
        {
            get { return _deadline; }
            set { _deadline = value; }
        }

        public bool ClubsCountries
        {
            get { return _clubsCountries; }
            set { _clubsCountries = value; }
        }

        public int LanesCount
        {
            get { return _lanesCount; }
            set { _lanesCount = value; }
        }

        public int WebId
        {
            get { return _webId; }
            set { _webId = value; }
        }

        public string[] LanesQuality
        {
            get 
            {
                if (_lanesQuality == null)
                    _lanesQuality = new string[1];
                return _lanesQuality;
            }
            set 
            {
                _lanesQuality = value;
            }
        }

        public bool IsActive
        {
            get { return _isActive; }
            set { _isActive = value; }
        }

        public bool Sync
        {
            get { return _sync; }
            set { _sync = value; }
        }

        public string Info
        {
            get
            {
                string s = _city + " " + _dateFrom.ToString("dd.MM.yyyy");
                if (_dateTo > _dateFrom)
                    s += " - " + _dateTo.ToString("dd.MM.yyyy");
                return s;
            }
        }
        
    }
}
